import requests

s = requests.session()

groups = [
    (0, '4', list(range(1, 5))),
    (1, '5', list(range(5, 26))),
    (2, '27', list(range(26, 35))),
    (3, '35', list(range(35, 60)) + [264, 265]),
    (4, '60', list(range(60, 83))),
    (5, '83', list(range(63, 107))),
    (6, '107', list(range(107, 135))),
    (7, '135', list(range(135, 171))),
    (8, '171', list(range(171, 192))),
    (9, '219', list(range(192, 225))),
    (10, '225', list(range(225, 244))),
    (11, '244', list(range(244, 264))),
]

for group_name, users in groups:
    for user in users:
        r = s.put('http://47.111.13.38/api/user/{}'.format(user), json={
            'role': 'User',
            'group': str(group_name)
        }).text
        print(r)
